<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/common/taglibs.jsp"%>
<!DOCTYPE html>
<html class="ng-app:myApp" id="ng-app" ng-app="myApp" xmlns:ng="http://angularjs.org">
<head>
<title>调度单管理</title>
<%@ include file="/WEB-INF/common/meta.jsp"%>
<%@ include file="/WEB-INF/layouts/global_res_header.jsp"%>
</head>

<body ng-controller="shipmentCtrl">
	<div id="mainDataBlock" ng-grid="gridOptions" class="demo1"></div>
	<div id="funcBlock" class="alert alert-info">
		<div class="btn-group btn-group-sm">
			<button type="button" class="btn btn-default" ng-click="onOpenQueryFormModal()">
				<span class="glyphicon glyphicon-search"></span> 查询
			</button>
			<button type="button" class="btn btn-default" ng-click="refresh()" id="bt">
				<span class="glyphicon glyphicon-refresh"></span> 刷新
			</button>
			<shiro:hasPermission name="sys:shipment:export">
			<button type="button" class="btn btn-default" ng-click="onOpenExportFormModal()">
				<span class="glyphicon glyphicon-export"></span> 导出
			</button>
			</shiro:hasPermission>
		</div>
	</div>
</body>

<div id="queryFormModal" class="modal" tabindex="-1" data-width="450px">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
		<h4 class="modal-title">查询</h4>
	</div>
	<div class="modal-body">
		<div class="row">
			<div class="col-md-12">
				<form name="queryFormForm" class="form-inline" role="form">	
					<div class="form-group">
						<label for="cd">调度单号</label> 
						<input name="cd" ng-model="queryForm.cd" class="form-control" placeholder="调度单号">		
					</div>								
					<div class="form-group" style="margin-left: 12px;">
						<label for="status">状态</label>
						<select name="status" ui-select2="{width:'150px', allowClear:'true'}" ng-model="queryForm.status" style="width: 100%" class="select2" data-placeholder="状态">
							<option value=""></option>
							<option value=""></option>
							<option ng-repeat="shipment in shipmentList" value="{{shipment.descr}}">{{shipment.val}}</option>
						</select>
					</div>
					<div class="form-group" style="margin-left: 24px;margin-top: 5px;">
						<label for="driverId">司机</label>
						<select name="driverId" ui-select2="{width:'150px', allowClear:'true'}" ng-model="queryForm.driverId" class="select2" data-placeholder="承运商">
							<option value=""></option>
							<option value=""></option>
							<option ng-repeat="driver in driverList" value="{{driver.id}}">{{driver.name}}</option>
						</select>
					</div>
					<div class="form-group top">
						<label for="carNo">车牌号</label> 
						<input name="carNo" ng-model="queryForm.carNo" class="form-control" placeholder="车牌号">		
					</div>
				</form>
			</div>
		</div>	
	</div>
	<div class="modal-footer">
		<button type="button" data-dismiss="modal" class="btn btn-default">关闭</button>
		<button ng-click="onQuery()" ng-disabled="queryFormForm.$invalid" class="btn btn-default">查询</button>
	</div>
</div>

<div id="editFormModal" class="modal" tabindex="-1" data-width="1100">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
		<h4 class="modal-title">调度单管理</h4>
	</div>
<div class="modal-body">
		<div class="row">
			<div class="col-md-12">
				<form name="editFormForm" role="form" novalidate>
					<input type="hidden" name="id" ng-model="editForm.id" class="form-control">
					<div class="row">
						<div class="col-sm-3" id="cd">						
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;调度单号： <input name="cd" ng-disabled="flagOfCd"  ng-model="editForm.cd"  class="form-control" placeholder="调度单号">		
						</div>
						<div class="col-sm-3">							
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="spancss">*</span>承运商： <select name="constractorId" id="c"  ng-required="true" ui-select2="{width:'150px', allowClear:'true'}" ng-model="editForm.constractorId" class="select2" data-placeholder="承运商" ng-disabled="flagc">
								<option value=""></option>
								<option ng-repeat="constractor in constractorList" value="{{constractor.id}}">{{constractor.shortName}}</option>
							</select>						
						</div>	
						<div class="col-sm-3" id="ft">							
							&nbsp;&nbsp;<span class="spancss">*</span>出发地： <select name="ftranslocationId"  ng-required="true" ui-select2="{width:'150px', allowClear:'true'}" ng-model="editForm.ftranslocationId" class="select2" data-placeholder="出发地">
								<option value=""></option>
								<option ng-repeat="translocation in translocationList" value="{{translocation.id}}">{{translocation.name}}</option>
							</select>						
						</div>	
						<div class="col-sm-3" id="tt">							
							&nbsp;&nbsp;&nbsp;&nbsp;<span class="spancss">*</span>目的地： <select name="ttranslocationId"  ng-required="true" ui-select2="{width:'150px', allowClear:'true'}" ng-model="editForm.ttranslocationId" class="select2" data-placeholder="目的地">
								<option value=""></option>
								<option ng-repeat="translocation in translocationList" value="{{translocation.id}}">{{translocation.name}}</option>
							</select>						
						</div>							
					</div>
					<div class="row top">
						<div class="col-sm-3">							
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="spancss">*</span>运输工具： <select name="vehicleId"  id="vh" ui-select2="{width:'150px', allowClear:'true'}" ng-model="editForm.vehicleId" class="select2" data-placeholder="运输工具" ng-required="true">
								<option value=""></option>
								<option ng-repeat="vehicle in vehicleList" value="{{vehicle.id}}">{{vehicle.cd}}</option>
							</select>						
						</div>
						<div class="col-sm-3">							
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;车牌号： <input name="carNo" ng-model="editForm.carNo"  class="form-control" placeholder="车牌号" disabled="disabled">		
						</div>
						<div class="col-sm-3">							
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;车型： <select name="vehicleTypeId" ui-select2="{width:'150px', allowClear:'true'}"  ng-model="editForm.vehicleTypeId" class="select2" data-placeholder="配载方式" disabled="disabled">
								<option value=""></option>
								<option ng-repeat="vehicleType in vehicleTypeList" value="{{vehicleType.id}}">{{vehicleType.name}}</option>
							</select>		
						</div>
						<div class="col-sm-3">						
							&nbsp;&nbsp;运输方式： <select name="shipment_method" ui-select2="{width:'150px', allowClear:'true'}"  ng-model="editForm.shipment_method" class="select2" data-placeholder="运输方式">
								<option value=""></option>
								<option ng-repeat="shipment_method in shipment_methodList" value="{{shipment_method.descr}}">{{shipment_method.val}}</option>
							</select>		
						</div>												
					</div>
					<div class="row top">
						<div class="col-sm-3">							
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;司机： <select name="driverId"  id="d" ui-select2="{width:'150px', allowClear:'true'}" ng-model="editForm.driverId" class="select2" data-placeholder="司机">
								<option value=""></option>
								<option ng-repeat="driver in driverList" value="{{driver.id}}">{{driver.name}}</option>
							</select>
						</div>
						<div class="col-sm-3">							
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;司机名称： <input name="driverName" ng-model="editForm.driverName" class="form-control" placeholder="司机名称">		
						</div>
						<div class="col-sm-3">						
							联系电话： <input name="phone" ng-model="editForm.phone" class="form-control" placeholder="联系电话">		
						</div>
						<div class="col-sm-3">						
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;身份证： <input name="idcard" ng-model="editForm.idcard" class="form-control" placeholder="身份证">		
						</div>
					</div>
						<div class="row top">
						<div class="col-sm-3">						
							计划发车时间： <input name="planltime" ng-model="editForm.planltime" class="form-control" placeholder="计划发车时间">		
						</div>
						<div class="col-sm-3">							
							预计到达时间： <input name="planatime" ng-model="editForm.planatime" class="form-control" placeholder="预计到达时间">		
						</div>
						<div class="col-sm-3">							
							跟踪单号： <input name="gzNo" ng-model="editForm.gzNo" class="form-control" placeholder="跟踪单号">		
						</div>
							<div class="col-sm-3">
							<span class="spancss">*</span>业务类型： <select name="vocationType" ui-select2="{width:'150px', allowClear:'true'}" ng-required="true" ng-model="editForm.vocationType" class="select2" data-placeholder="业务类型">
								<option value=""></option>
								<option ng-repeat="cd in cdList" value="{{cd.descr}}">{{cd.val}}</option>
							</select>
						</div>	
					</div>
					<div class="row top">
						<div class="col-sm-3">							
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;件数： <input name="quantity" ng-model="editForm.quantity" class="form-control" placeholder="件数">		
						</div>
						<div class="col-sm-3">							
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;重量： <input name="weight" ng-model="editForm.weight" class="form-control" placeholder="重量">		
						</div>
						<div class="col-sm-3">							
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;体积： <input name="volume" ng-model="editForm.volume" class="form-control" placeholder="体积">		
						</div>
						<div class="col-sm-3">							
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;托数： <input name="palletsum" ng-model="editForm.palletsum" class="form-control" placeholder="体积">		
						</div>
					</div>	
					<div class="row top">
						<div class="col-sm-3">							
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;送货点数： <input  name="points" ng-model="editForm.points" class="form-control" placeholder=">送货点数">		
						</div>					
						<div class="col-sm-3">							 
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;一口价： <input  name="expense" ng-model="editForm.expense" class="form-control" placeholder="一口价">		
						</div>
						<div class="col-sm-3">							
							预计费用： <input  name="expectMoney" ng-model="editForm.expectMoney" class="form-control" placeholder="体积">		
						</div>
						<div class="col-sm-3">							
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;描述： <input  name="descr" ng-model="editForm.descr" class="form-control" placeholder="描述">		
						</div>
					</div>	
			</form>
			</div>
		</div>
	</div>
	<div style="width: 1095px;">
		<div id="mainDatas" ng-grid="gridOption" style="width: 100%;"></div>
	</div>
	<div class="modal-footer">
	<div style="float: left;margin-right: 800px;margin-left: 10px;">
		<button type="button" ng-click="onOpenEditFormModalL()" class="btn btn-default" ng-disabled="addflag">添加</button>
		<button type="button" ng-click="cancel()" class="btn btn-default" ng-disabled="cancelflag">取消调度</button>
	</div>
	<div style="float: left">
		<button type="button" data-dismiss="modal" id="btn" class="btn btn-default">关闭</button>
		<button ng-click="onSaveEditForm()" ng-disabled="editFormForm.$invalid" class="btn btn-default">提交</button>
	</div>
	</div>
</div>

<div id="editFormModalL" class="modal" tabindex="-1" data-width="900"style="display: none;">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
		<h4 class="modal-title">调度单管理</h4>
	</div>
		<div style="height: 60px">
			<form name="queryFormFormlg" class="form-inline" role="form">	
					<div class="form-group" style="margin-top: 5px;margin-left: 12px">
						<label for="clientId">客户</label>
						<select name="clientId" ui-select2="{width:'150px', allowClear:'true'}" ng-model="queryFormlg.clientId" style="width: 100%" class="select2" data-placeholder="客户">
							<option value=""></option>
							<option value=""></option>
							<option ng-repeat="client in clientList" value="{{client.id}}">{{client.shortName}}</option>
						</select>
					</div>	
					<div class="form-group" style="margin-left: 12px;margin-top: 5px">
						<label for="orderCd">订单号</label>
						 <input name="orderCd" ng-model="queryFormlg.orderCd" class="form-control" placeholder="订单号" style="width:130px;">
					</div>	
					<div class="form-group" style="margin-top: 5px;margin-left: 35px">
						<label for="shipment_method">运输方式</label> <select
							name=shipment_method " ui-select2="{width:'130px', allowClear:'true'}"
							ng-model="queryFormlg.shipment_method" style="width: 100%" class="select2"
							data-placeholder="运输方式">
							<option value=""></option>
							<option value=""></option>
							<option ng-repeat="shipmentMethod in shipment_methodList" value="{{shipmentMethod.descr}}">{{shipmentMethod.val}}</option>
						</select>
					</div>						
					<div class="form-group" style="margin-left: 24px;margin-top: 5px;">
						<label for="orderCd1">批量单号</label>
						<textarea style="width: 160px;height: 50px"  name="orderCd1" ng-model="queryFormlg.orderCd1" class="form-control"></textarea>
					</div>
					<button ng-click="onFilter()" ng-disabled="queryFormFormlg.$invalid" class="btn btn-default">查询</button>			
				</form>
		</div>
		<div id="mainDataL" ng-grid="gridOptionL" style="width: 895px;"></div>
	<div class="modal-footer">
		<button type="button" ng-click="add()" class="btn btn-default">添加</button>
		<button type="button" data-dismiss="modal" class="btn btn-default">关闭</button>
	</div>
</div>


<div id="confirmFormModal" class="modal" tabindex="-1" data-width="300"style="display: none;">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
		<h4 class="modal-title"></h4>
	</div>
	<div style="height: 40px;margin-left: 20px;margin-top: 15px;">
	<form name="editFormForm" class="form-horizontal" role="form" novalidate>
		确认时间：<input name="time" style="width: 150px;display: inline;" ng-model="editForm.time" class="form-control" placeholder="派车确认">		
			   <input name="status" style="display: none;" ng-model="editForm.status" class="form-control" placeholder="派车确认">		
	</form>
	</div>
	<div class="modal-footer">
		<button type="button" data-dismiss="modal" class="btn btn-default">关闭</button>
		<button type="button" ng-click="Confirm()" class="btn btn-default">确认</button>
	</div>
</div>

<div id="importFormModal" class="modal" tabindex="-1" data-width="300px" style="display: none;">
	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
		<h4 class="modal-title">更改一口价</h4>
	</div>
	<div class="modal-body">
		<div style="margin-left: 20px;">
			<form name="editFormFormex" class="form-horizontal" role="form" novalidate>
				一口价：<input  name="expense" style="width: 150px;display: inline;" ng-model="editFormEx.expense" class="form-control" placeholder="一口价">		
			</form>
		</div>
	</div>
	<div class="modal-footer">
		<button type="button" data-dismiss="modal" class="btn btn-default">关闭</button>
		<button type="button" ng-disabled="editFormFormex.$invalid" ng-click="onChangeEx()" class="btn btn-primary">提交</button>
	</div>
</div>  
<div class="contextMenu" id="menu">
	<ul>
		<li id="find" ng-click="onOpenQueryFormModal()">
		 <img src=""/> 
		&nbsp;查询&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
		<li id="refresh" ng-click="refresh()">
		 <img src=""/> 
		&nbsp;刷新&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
		<shiro:hasPermission name="sys:shipment:add">
		<li id="save" ng-click="onOpenEditFormModal('add')">
		 <img src=""/> 
		&nbsp;增加&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
		</shiro:hasPermission>
		<shiro:hasPermission name="sys:shipment:upd">
		<li id="edit" ng-click="onOpenEditFormModal('upd')">
		 <img src=""/> 
		&nbsp;编辑&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
		</shiro:hasPermission>
		<shiro:hasPermission name="sys:shipment:confirm">
		<li id="confirm" ng-click="onOpenConfirmFormModal('pc')">
		 <img src=""/> 
		&nbsp;派车确认&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
		</shiro:hasPermission>
		<shiro:hasPermission name="sys:shipment:in">
		<li id="in" ng-click="onOpenConfirmFormModal('rk')">
		 <img src=""/> 
		&nbsp;车辆入库&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
		</shiro:hasPermission>
		<shiro:hasPermission name="sys:shipment:out">
		<li id="out" ng-click="onOpenConfirmFormModal('ck')">
		 <img src=""/> 
		&nbsp;车辆出库&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
		</shiro:hasPermission>
		<shiro:hasPermission name="sys:shipment:send">
		<li id="send" ng-click="onOpenConfirmFormModal('fy')">
		 <img src=""/> 
		&nbsp;发运确认&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
		</shiro:hasPermission>
		<shiro:hasPermission name="sys:shipment:arrive">
		<li id="arrive" ng-click="onOpenConfirmFormModal('yd')">
		 <img src=""/> 
		&nbsp;运抵确认&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
		</shiro:hasPermission>
		<shiro:hasPermission name="sys:shipment:refresh1">
		<li id="refresh1" ng-click="onOpenExpensetFormModal()">
		 <img src=""/> 
		&nbsp;更改一口价&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li>
		</shiro:hasPermission>
	</ul>
</div>
<%@ include file="/WEB-INF/layouts/global_res_footer.jsp"%>
<script type="text/javascript" src="${ctx}/res_oms/oms/shipment.js"></script>
<script type="text/javascript" src="${ctx}/res_oms/jquery.contextmenu.r2.js"></script>
</html>
